﻿var LastChild = 0;
var fDSp=(typeof(document.getElementById)!='undefined');
if (typeof(PageHost) == 'undefined') var PageHost = '';
function Trim(iStr)
{
	while (iStr.charCodeAt(0) <= 32)
	{
		iStr=iStr.substr(1);
	}

	while (iStr.charCodeAt(iStr.length - 1) <= 32)
	{
		iStr=iStr.substr(0, iStr.length - 1);
	}

	return iStr;
}


function ItemMinimize(Name)
{
	if (!fDSp)
	{
		return;
	}

	var MItem=document.getElementById('IDM_'.concat(Name));
	var Image=document.getElementById('IDI_'.concat(Name));
	
	if (MItem.style.display!='')
	{
		MItem.style.display='';
		Image.src='/images/min.gif';
	}
	else
	{
		MItem.style.display='none';
		Image.src='/images/max.gif';
	}
}

function AddHeader(Name, Header, Buttons, Symbol, AddChildTable)
{
	document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=1 ><tr><td>');

	if (Header!='')
	{
		document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0>');
		document.writeln('<tr>');

		if (typeof(Symbol)!='undefined')
		{
			document.writeln('<td height=20 class=headerwhite51><img src="', Symbol, '" border=0></td>');
		}

		document.writeln('<td height=20 width="100%" align=left class=headerwhite51>&nbsp;', Header, '</td>');

		if ((Buttons & 1) && fDSp)
		{
			document.write('<td width=15 align=right class=headerwhite51>');
			document.write('<a href="JavaScript:ItemMinimize(\x27', Name, '\x27)">');
			document.write('<img src="/images/min.gif" name="IDI_', Name, '" border=0 alt="Minimize | Maximize">');
			document.write('</a></td>');
		}

		document.writeln('</tr></table>');
	}

	document.writeln('<table width="100%" border=0 cellspacing=0 cellpadding=0><tr><td id="IDM_', Name, '">');
	if (typeof(AddChildTable)=='undefined')
	{
		document.writeln('<table align=center width="100%" cellspacing=0 cellpadding=0 border=1 class=text8>');
		LastChild = 1;
	}
	else
	{
		LastChild = 0;
	}
	return true;
}

function AddFooter(source)
{
	if (LastChild)
	{
		document.writeln('<tr><td class=text8 colspan="2"><i>',source,'</i></td></tr></table></td></tr></table></td></tr></table>');
	}
	else
	{
		document.writeln('</td></tr></table></td></tr></table>');
	}
}
var xmlHttp
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}
var speed = 100 
var pause = 1000 
var timerID = null
var texttype = false
var ar = new Array()
ar[0] = "Xin chào bạn đến với Website HoiTuSo.Net"
ar[1] = "Hoituso.net - Hội Tụ Số mọi dịch vụ trên một kết nối !"
var msgnow = 0
var offset = 0
function showBanner() {
        var text = ar[msgnow]

        if (offset < text.length) {
                if (text.charAt(offset) == " ")
                        offset++                        

                var partialMessage = text.substring(0, offset + 1) 
                window.status = partialMessage
                offset++ 
                timerID = setTimeout("showBanner()", speed)
                texttype = true
        } else {
                offset = 0
                msgnow++
                if (msgnow == ar.length)
                        msgnow = 0

                timerID = setTimeout("showBanner()", pause)
                texttype = true
        }
       
}
var the_timeout,active;
active = 0;
function promotion_show_hide()
{
    if (active == 0)
    {
	window.myPromotionL.style.visibility='hidden';
	window.myPromotionR.style.visibility='visible';	
	active = 1;		
    }
    else
    {
	window.myPromotionL.style.visibility='visible';	
	window.myPromotionR.style.visibility='hidden';
	active = 0;		
    }
    the_timeout=setTimeout("promotion_show_hide();",800);	
}

showBanner() ;
